package com.lanou.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.TimeZone;

/**
 * Created by dllo on 18/3/14.
 */
public class GetDate {

    //获取当前系统时间
    public static String getTime(){
        Calendar calendar = Calendar.getInstance();
        TimeZone timeZone = TimeZone.getTimeZone("Asia/Shanghai");
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        simpleDateFormat.setTimeZone(timeZone);
        String time = simpleDateFormat.format(calendar.getTime());
        return time;
    }


}
